package com.article.pojo.entity;

import com.article.pojo.dto.ArticleDto;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
public class Article {
    private Integer id;
    private String title;
    private String content;
    private Integer status;
    private int commentCount;
    private int likeCount;
    private int readCount;
    private LocalDateTime pub_date;
    private Integer channelId;
    private Integer coverId;

    public Article(ArticleDto articleDto) {
        this.title = articleDto.getTitle();
        this.content = articleDto.getContent();
        this.channelId = articleDto.getChannel_id();
        this.coverId = articleDto.getCover().getId();
    }
}
